package com.huangmb.anymark.server.model;


import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户，对应数据中的用户表
 *
 * @author hmb
 * @version 1.0
 * @since 2016/5/3 23:04
 */
@Entity
@Table(name = "user", catalog = "anymark")
public class User implements Serializable{
    private Integer id = 0;
    private String mName;
    private String mPassword;
    private String avatar;
    private Sex mSex;

    public User() {
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "avatar")
    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Column(name = "name", length = 20)
    public String getName() {
        return mName;
    }

    public void setName(String mName) {
        this.mName = mName;
    }

    @JSONField(serialize = false)
    @Column(name = "password", length = 20)
    public String getPassword() {
        return mPassword;
    }

    public void setPassword(String mPassword) {
        this.mPassword = mPassword;
    }

    @Column(name = "sex",length = 5)
    @Enumerated(EnumType.STRING)
    public Sex getSex() {
        return mSex;
    }

    public void setSex(Sex sex) {
        this.mSex = sex;
    }

}
